﻿using OA.Model.MyAttribute;
using Newtonsoft.Json;
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
//using System.Web.DynamicData;

namespace OA.Model
{
    /// <summary>
    /// 系统设置
    /// </summary>
    //[TableName("系统设置")]
    [Table("SysConfig")]
    public class SysConfig : BaseInfo
    {
        [MaxLength(20)]
        [Required]
        [Display(Name = "标题")]
        [Tag(TagEnum.Text, "required", "标题",5,20)]
        public string Name { get; set; }

        [MaxLength(20)]
        [Required]
        [Display(Name = "标识Key")]
        [Tag(TagEnum.Text, "required", "标识Key", 2,20)]
        public string Key { get; set; }

        [Required]
        [Display(Name = "配置内容")]
        [Tag(TagEnum.Text, "required", "配置内容", 0,200000)]
        public string Content { get; set; }

    }

    public class SimpleSysConfig :SimpleInfo
    {
        public string Name { get; set; }

        public string Key { get; set; }

        public static Expression<Func<SysConfig, SimpleSysConfig>> Map = m => new SimpleSysConfig()
        {
            ID = m.ID,
            Key = m.Key,
            Name = m.Name
        };
    }


}
